﻿using System;
using System.Collections;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Domain.Entities;
using Domain.Services;

namespace UserInterface
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Topic topic = TopicService.GetById(19);
            User user = UserService.GetById(2);
            //User user2 = UserService.GetById(2);

            Bookmark bookmark = BookmarkService.GetByTopicAndUser(topic, user);

            try
            {
                Response.Write(bookmark.User.Username + " - " + bookmark.SendEmail.ToString() + "<br>");
                BookmarkService.Update(bookmark, !bookmark.SendEmail);
            }
            catch (Exception ex)
            {
                Response.Write("<br><br><br>" + ex.Message + "<br><br><br>");
            }

            Response.Write(bookmark.User.Username + " - " + bookmark.SendEmail.ToString() + "<br>");
        }
    }
}
